import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { RecordTaskVO, RecordTaskForm, RecordTaskQuery } from '@/api/system/recordTask/types';

/**
 * 查询trtc录制任务列表
 * @param query
 * @returns {*}
 */

export const listRecordTask = (query?: RecordTaskQuery): AxiosPromise<RecordTaskVO[]> => {
  return request({
    url: '/system/recordTask/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询trtc录制任务详细
 * @param id
 */
export const getRecordTask = (id: string | number): AxiosPromise<RecordTaskVO> => {
  return request({
    url: '/system/recordTask/' + id,
    method: 'get'
  });
};

/**
 * 新增trtc录制任务
 * @param data
 */
export const addRecordTask = (data: RecordTaskForm) => {
  return request({
    url: '/system/recordTask',
    method: 'post',
    data: data
  });
};

/**
 * 修改trtc录制任务
 * @param data
 */
export const updateRecordTask = (data: RecordTaskForm) => {
  return request({
    url: '/system/recordTask',
    method: 'put',
    data: data
  });
};

/**
 * 删除trtc录制任务
 * @param id
 */
export const delRecordTask = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/recordTask/' + id,
    method: 'delete'
  });
};
